const _import = filePath => () => import ('../views/' + filePath + '.vue')

export default [
  // 登录
  {
    path: '/login',
    name: 'login',
    component: _import('login/index')
  },
  {
    path: '/index',
    name: 'index',
    component: _import('index'),
    meta: { title: '概览', sidebar: 'show', appHeader: 'show' }
  },
  {
    path: '/brand',
    name: 'brandManage',
    component: _import('brandManage/index'),
    meta: { title: '品牌管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'brandList' },
    children: [{
        path: 'list',
        name: 'brandList',
        component: _import('brandManage/list'),
        meta: { name: 'brandManage', title: '', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'addnewbrand/:id?',
        name: 'addnewbrand',
        component: _import('brandManage/addnewbrand'),
        meta: { title: '新品牌', type: 'edit', name: 'brandManage', sidebar: 'show', appHeader: 'show' }
      }
    ]
  },
  {
    path: '/find',
    name: 'findManage',
    component: _import('findManage/index'),
    meta: { title: '找材管理', sidebar: 'show', appHeader: 'show', openIndex: 'findManage' },
    redirect: { name: 'findList' },
    children: [{
        path: 'material',
        name: 'findList',
        component: _import('findManage/list/index'),
        meta: { name: 'findList', title: '找材列表', sidebar: 'show', appHeader: 'show', openIndex: 'findManage' },
        redirect: { name: 'findMaterialList' },
        children: [{
            path: 'list',
            name: 'findMaterialList',
            component: _import('findManage/list/materialList'),
            meta: { name: 'findList', openIndex: 'findManage', sidebar: 'show', appHeader: 'show' },
          },
          {
            path: 'detail/:id',
            name: 'findMaterialDetail',
            component: _import('findManage/list/detail'),
            meta: { name: 'findList', title: '详情', openIndex: 'findManage', sidebar: 'show', appHeader: 'show' },
          }
        ]
      },
      {
        path: 'message',
        name: 'message',
        component: _import('findManage/message'),
        meta: { name: 'message', title: '消息回复', sidebar: 'show', appHeader: 'show' }
      }
    ]
  },
  {
    path: '/orders',
    name: 'orders',
    component: _import('orders/index'),
    meta: { title: '样品订单', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'orderList' },
    children: [{
        path: 'list',
        name: 'orderList',
        component: _import('orders/list'),
        meta: { name: 'orders', openIndex: 'orders', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'detail/:id',
        name: 'orderDetail',
        component: _import('orders/detail'),
        meta: { name: 'orders', title: '详情', openIndex: 'orders', sidebar: 'show', appHeader: 'show' },
      }
    ]
  },
  {
    path: '/notice',
    name: 'noticeManage',
    component: _import('notice/index'),
    meta: { title: '通知管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'noticeList' },
    children: [{
      path: 'list',
      name: 'noticeList',
      component: _import('notice/list'),
      meta: { name: 'noticeManage', openIndex: 'noticeManage', sidebar: 'show', appHeader: 'show' },
    }, ]
  },
  {
    path: '/person',
    name: 'personManage',
    component: _import('personManage/index'),
    meta: { title: '人员管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'personList' },
    children: [
      {
        path: 'list',
        name: 'personList',
        component: _import('personManage/list'),
        meta: { name: 'personManage', openIndex: 'personManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'audit',
        name: 'personAudit',
        component: _import('personManage/audit'),
        meta: { title: '人员审核', name: 'personManage', openIndex: 'personManage', sidebar: 'show', appHeader: 'show' },
      }
    ]
  },
  {
    path: '/case',
    name: 'caseManage',
    component: _import('caseManage/index'),
    meta: { title: '案例管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'caseList' },
    children: [{
        path: 'list',
        name: 'caseList',
        component: _import('caseManage/list'),
        meta: { name: 'caseList', openIndex: 'caseManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'edit/:id?',
        name: 'caseEdit',
        component: _import('caseManage/edit'),
        meta: { title: `案例`, type: 'edit', name: 'caseList', openIndex: 'caseManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'tag',
        name: 'tagManage',
        component: _import('caseManage/tag'),
        meta: { title: `标签管理`, name: 'tagManage', openIndex: 'caseManage', sidebar: 'show', appHeader: 'show' },
      }
    ]
  },
  {
    path: '/account',
    name: 'account',
    component: _import('account/index'),
    meta: { title: '我的', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'info' },
    children: [{
        path: 'info',
        name: 'info',
        component: _import('account/info/index'),
        meta: { name: 'basicInfo', title: '基本信息', sidebar: 'show', appHeader: 'show', openIndex: 'account' },
        redirect: { name: 'basicInfo' },
        children: [
          {
            path: 'basicInfo',
            name: 'basicInfo',
            component: _import('account/info/basicInfo'),
            meta: { name: 'basicInfo', sidebar: 'show', appHeader: 'show', openIndex: 'account' },
          },
          {
            path: 'editInfo',
            name: 'editInfo',
            component: _import('account/info/editInfo'),
            meta: { name: 'basicInfo', title: '编辑', sidebar: 'show', appHeader: 'show', openIndex: 'account' }
          }
        ]
      },
      
      {
        path: 'changePwd',
        name: 'changePwd',
        component: _import('account/changePwd'),
        meta: { name: 'changePwd', title: '修改密码', sidebar: 'show', appHeader: 'show', openIndex: 'account' }
      },
      {
        path: 'system',
        name: 'system',
        component: _import('account/system'),
        meta: { name: 'system', title: '系统管理', sidebar: 'show', appHeader: 'show', openIndex: 'account' }
      },
      {
        path: 'logs',
        name: 'logs',
        component: _import('account/logs'),
        meta: { name: 'logs', title: '操作日志', sidebar: 'show', appHeader: 'show', openIndex: 'account' }
      }
    ]
  },
  {
    path: '/material',
    name: 'material',
    component: _import('materials/index'),
    meta: { name: 'material', title: '材料管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'materialList' },
    children: [{
        path: 'list',
        name: 'materialList',
        component: _import('materials/list'),
        meta: { name: 'material', sidebar: 'show', appHeader: 'show' }
      },
      {
        path: 'draft',
        name: 'materialDraft',
        component: _import('materials/draft'),
        meta: { title: '草稿箱', name: 'material', sidebar: 'show', appHeader: 'show' }
      },
      {
        path: 'upload/:id?',
        name: 'upload',
        component: _import('materials/upload'),
        meta: { title: '添加材料', name: 'material', sidebar: 'show', appHeader: 'show' }
      },
      {
        path: 'detail/:id',
        name: 'goodsDetail',
        component: _import('materials/detail'),
        meta: { title: '材料详情', name: 'material', sidebar: 'show', appHeader: 'show' }
      }
    ]
  },
  // 在线入库调查
  {
    path: '/survey',
    name: 'survey',
    component: _import('survey/__index')
  },
  // 小程序管理
  {
    path: '/applt',
    name: 'appltManage',
    component: _import('applt/index'),
    meta: { title: '小程序管理设置', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'appltMaterial' },
    children: [
      {
        path: 'material',
        name: 'appltMaterial',
        component: _import('applt/material'),
        meta: { name: 'appltManage', openIndex: 'appltManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'case',
        name: 'appltCase',
        component: _import('applt/case'),
        meta: { name: 'appltManage', openIndex: 'appltManage', sidebar: 'show', appHeader: 'show' },
      }
    ]
  },
  // 图片管理
  {
    path: '/image',
    name: 'imageManage',
    component: _import('image/index'),
    meta: { title: '图片管理', sidebar: 'show', appHeader: 'show' },
    redirect: { name: 'imageList' },
    children: [
      {
        path: 'list',
        name: 'imageList',
        component: _import('image/list'),
        meta: { name: 'imageManage', openIndex: 'imageManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'photoList/:id',
        name: 'photoList',
        component: _import('image/photoList'),
        meta: { title: '图片册管理', name: 'imageManage', openIndex: 'imageManage', sidebar: 'show', appHeader: 'show' },
      },
      {
        path: 'edit/:id?',
        name: 'imageEdit',
        component: _import('image/edit'),
        meta: { title: '图片册', type: 'edit', name: 'imageManage', openIndex: 'imageManage', sidebar: 'show', appHeader: 'show' },
      }
    ]
  }
]